﻿using Logistics.Web.Models.Common;
using System;
using System.Collections.Generic;

namespace Logistics.Web.Models.Order
{
    public class SummaryModel
    {
        public SummaryModel()
        {
            Locations = new List<LocationModel>();
            CurrentPackages = new List<PackageModel>();
        }

        public AddressModel BillingAddress { get; set; }
        public AddressModel UserAddress { get; set; }

        public decimal SubTotalExcSurchargeTax { get; set; }

        public decimal FuelSurchargeRate { get; set; }
        public decimal FuelSurcharge { get; set; }
        public decimal TaxRate { get; set; }
        public decimal Tax { get; set; }
        public decimal Discount { get; set; }
        public decimal CurrentPackageTotal { get; set; }
        public decimal SubTotalExcCurrentPackage { get; set; }
        public decimal Total { get; set; }

        public List<PackageModel> CurrentPackages { get; set; }
        public int TotalPackages { get; set; }

        public decimal RegularDimensionSize { get; set; }
        public decimal MaxDimensionSize { get; set; }
        public decimal RegularWeight { get; set; }
        public decimal MaxWeight { get; set; }

        public List<LocationModel> Locations { get; set; }

        public PaymentInfoType PaymentInfo { get; set; }
        public bool IsPaymentExempt { get; set; }
        public bool IsGiftCardApplied { get; set; }
        public string GiftCardCode { get; set; }
        public bool ShowCurrentPackage { get; set; }
        public int UserId { get; set; }
        public int OrderId { get; set; }

        public int CreditCardId { get; set; }

        #region Nested

        public class LocationModel
        {
            public LocationModel()
            {
                Packages = new List<PackageModel>();
            }

            public bool IsUserAddressPickup { get; set; }
            public bool IsGiftCardApplied { get; set; }
            public AddressModel UserAddress { get; set; }
            public AddressModel Address { get; set; }
            public List<PackageModel> Packages { get; set; }

            public decimal SubTotalExcSurchageTax { get; set; }
            public decimal FuelSurcharge { get; set; }
            public decimal Tax { get; set; }
            public decimal SubTotal { get; set; }

            public decimal RegularCharge { get; set; }


            //the pickupTime selected  by user  
            public string PickupTimeUserSelected { get; set; }

            public string PickupTimeStart { get; set; }
            public string PickupTimeEnd { get; set; }
            public string PickupTimeStr { get; set; }
            public string OrderByInfo { get; set; }

            public string AdditionalInstruction { get; set; }
        }

        public class PackageModel
        {
            public string Name { get; set; }
            public string Comment { get; set; }
            public string Attributes { get; set; }
            public decimal Charge { get; set; }
            public decimal? Insurance { get; set; }
            public int? PackagePreset { get; set; }
            public int Id { get; set; }
        }

        public class PaymentInfoType
        {
            public string CardNumber { get; set; }
            public string CardType { get; set; }
            public int ExpMonth { get; set; }
            public int ExpYear { get; set; }
            public string CardHolder { get; set; }

            public int Id { set; get; }
        }

        #endregion

    }
}